function delay(ms) {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve();
    }, ms);
  });
}

// 使用示例
delay(1000).then(() => {
  console.log("Delayed for 1 second");
});
